package com.zyd.shiro.persistence.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.zyd.shiro.persistence.beans.OrderAddress;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
public interface MallOrderAddressDao extends JpaRepository<OrderAddress,Integer>,JpaSpecificationExecutor<OrderAddress>{

    @Query(value = "select * from mall_order_address address where address.order_id = ?1",nativeQuery = true)
    OrderAddress findByOrder_id(Integer orderId);

    @Query(value = "select * from mall_order_address bean where bean.region_id = ?1",nativeQuery = true)
    List<OrderAddress> allRegionByRegionId(Integer regionId);

}
